//
// Created by 张玭 on 24-6-17.
//

# include "iostream"
#include "../HeadFiles/workerManager.h"
#include "../HeadFiles/employee.h"
#include "../HeadFiles/manager.h"
#include "../HeadFiles/worker.h"
#include "../HeadFiles/utils.h"

using namespace std;

int main() {
    // test();//测试

    //实例化管理者对象
    workerManager wm;
    wm.showMenu();
    wm.readFromFile(); //初始化员工
    int choice = 0;
    while (true) {
        cout << "请输入您的选择：" << endl;
        cin >> choice;
        switch (choice) {
            case 0: //退出系统
                wm.exitSystem();
                break;
            case 1: //增加职工
                wm.addEmp();
                break;
            case 2: //显示职工
                wm.showEmp();
                break;
            case 3: //删除职工
                wm.printEmpIds();
                wm.delEmp();
                break;
            case 4: //修改职工
                wm.modEmp();
                break;
            case 5: //查找职工
                wm.findEmp();
                break;
            case 6: //排序职工
                wm.sortEmp();
                break;
            case 7: //清空文档
                wm.clearFile();
                break;
            default:
                // system("cls");
                cout << "输入有误，请重新输入" << endl;
                break;
        }
    }
    return 0;
}
